package com.aloneness.dingtalk.learn.dao;

import com.aloneness.dingtalk.learn.domain.Express;
import com.aloneness.dingtalk.learn.domain.ExpressDetail;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface ExpressDao {

    /**
     * 查找所有订单
     *
     * @param keyword
     * @return
     */
    List<Express> selectExpressList(@Param(value = "keyword") String keyword);

    /**
     * 查找发布订单
     *
     * @param publishId
     * @return
     */
    List<Express> selectPublishExpressList(@Param(value = "publishId") String publishId);

    /**
     * 查找接收的订单
     *
     * @param acceptId
     * @return
     */
    List<Express> selectAcceptExpressList(@Param(value = "acceptId") String acceptId);

    /**
     * 根据ID查询订单
     *
     * @param expressId
     * @return
     */
    Express selectExpressById(@Param(value = "expressId") int expressId);

    /**
     * 更新快递信息
     *
     * @param express
     * @return
     */
    int updateExpress(Express express);

    /**
     * 插入快递信息
     *
     * @param expressDetail
     * @return
     */
    int insertExpressDetail(ExpressDetail expressDetail);

    /**
     * 插入快递详情
     *
     * @param express
     * @return
     */
    int insertExpress(Express express);

    /**
     * 订单完成时间
     *
     * @param expressDetail
     * @return
     */
    int updateFinishTime(ExpressDetail expressDetail);
}
